import 'package:submail_one_login_flutter/model/base_sub_result.dart';

class LoginTokenModel extends BaseSubResult {
  //{"resultCode":"103000","authType":"0","authTypeDes":"其他","openId":"openId","token":"STsid0000001705475227850WU0UaCQO1IvoOT0w6idWvhVg0hECY6bl","tokenExpiresIn":"600","traceId":"99b7e6f47d234a5995ee006e24f72efd","scripExpiresIn":"0"}

  String? authType,
      authTypeDes,
      openId,
      token,
      tokenExpiresIn,
      traceId,
      scriptExpiresIn;

  LoginTokenModel(
      super.resultCode,
      this.authType,
      this.authTypeDes,
      this.openId,
      this.token,
      this.tokenExpiresIn,
      this.traceId,
      this.scriptExpiresIn);

  factory LoginTokenModel.fromJson(Map json) {
    return LoginTokenModel(
      json['resultCode']?.toString(),
      json['authType']?.toString(),
      json['authTypeDes']?.toString(),
      json['openId']?.toString(),
      json['token']?.toString(),
      json['tokenExpiresIn']?.toString(),
      json['traceId']?.toString(),
      json['scriptExpiresIn']?.toString(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      "resultCode": resultCode,
      "authType": authType,
      "authTypeDes": authTypeDes,
      "openId": openId,
      "token": token,
      "tokenExpiresIn": tokenExpiresIn,
      "traceId": traceId,
      "scriptExpiresIn": scriptExpiresIn,
    };
  }
}
